﻿using System;
using Abp.Domain.Entities.Auditing;
using Camc.Quality.Quality;
using JetBrains.Annotations;

namespace Camc.Quality.Bop
{
    /// <summary>
    ///     树形结构节点表
    /// </summary>
    public class BopNode : FullAuditedEntity<Guid>
    {
        //public override Guid Id { get; set; }
        public Guid BopDescId { get; set; }

        /// <summary>
        ///     父节点Id
        /// </summary>
        public Guid ParentId { get; set; }

        /// <summary>
        ///     节点图号
        /// </summary>
        public string NodeDrawingNo { get; set; }

        /// <summary>
        ///     节点名称
        /// </summary>
        public string NodeName { get; set; }

        /// <summary>
        ///     节点类型：0：自建，1：关联生成
        /// </summary>
        public NodeType NodeType { get; set; }

        /// <summary>
        ///     序号
        /// </summary>
        public int Sort { get; set; }

        /// <summary>
        ///     层级
        /// </summary>
        public int NodeLevel { get; set; }

        /// <summary>
        ///     工艺规程编号
        /// </summary>
        [CanBeNull]
        public string ProcessCode { get; set; }

        /// <summary>
        ///     是否叶节点
        /// </summary>
        public int IsLeaf { get; set; }

        /// <summary>
        ///     父节点Code：001_001
        /// </summary>
        [CanBeNull]
        public string ParentCode { get; set; }

        /// <summary>
        ///     子节点Code： 001_001_001
        /// </summary>
        [CanBeNull]
        public string NodeCode { get; set; }

        /// <summary>
        ///     是否导出
        /// </summary>
        public int IsExport { get; set; }
        /// <summary>
        /// 是否导出Bop树
        /// </summary>
        public bool BopExprot { get; set; }

        /// <summary>
        /// 是否导出计划树
        /// </summary>
        public bool PlanExprot { get; set; }


        /// <summary>
        ///     已导出Pad端Id
        /// </summary>
        [CanBeNull]
        public string PadId { get; set; }

        /// <summary>
        ///     已导出Pad端Name
        /// </summary>
        [CanBeNull]
        public string PadName { get; set; }

        /// <summary>
        ///     工艺文件ID
        /// </summary>
        [CanBeNull]
        public Guid? TechniqueEntityId { get; set; }

        /// <summary>
        ///     是否回传
        /// </summary>
        public int IsReturn { get; set; }

        /// <summary>
        ///     关联时间
        /// </summary>
        [CanBeNull]
        public DateTime? RelationDate { get; set; }

        /// <summary>
        ///     导出时间
        /// </summary>
        [CanBeNull]
        public DateTime? ExportDate { get; set; }

        /// <summary>
        ///     回传时间
        /// </summary>
        [CanBeNull]
        public DateTime? ReturnDate { get; set; }

        /// <summary>
        ///     建立表外键
        /// </summary>
        public BopContent BopContents { get; set; }

        #region 工艺路线

        /// <summary>
        ///     前端所需坐标
        /// </summary>
        public string Loc { get; set; }

        /// <summary>
        ///     详情
        /// </summary>
        public string Details { get; set; }

        /// <summary>
        ///     形状
        /// </summary>
        public string Figure { get; set; }

        /// <summary>
        ///     字体和边框颜色
        /// </summary>
        public string Color { get; set; }

        /// <summary>
        ///     大小
        /// </summary>
        public int Size { get; set; }

        /// <summary>
        ///   底色
        /// </summary>
        public string Fill { get; set; }



        /// <summary>
        ///     工时
        /// </summary>
        public decimal WorkingHour { get; set; }

        #endregion

        #region 排配计划
        [CanBeNull]
        /// <summary>
        /// 计划开始时间
        /// </summary>
        public DateTime? StartTime { get; set; }
        [CanBeNull]
        /// <summary>
        /// 计划完成时间
        /// </summary>
        public DateTime? EndTime { get; set; }
        #endregion

        [CanBeNull]
        /// <summary>
        /// 配套状况
        /// </summary>
        public AssortStatus AssortState { get; set; }
    }
}